<?php 
define('IN_QY',true);
session_start();
require("include/common.inc.php");
require_once("include/config.php");
require_once("include/httpUtil.php");
header("Content-type: text/html; charset=utf-8");
define('SCRIPT','ad_list');
if(!$_COOKIE['userid']){
    echo "<script type='text/javascript'>location.href='mlogin.php';</script>";
    exit;
}
$sqlsm = "select * from tbl_shiming where userid=".$_COOKIE['userid'];
$querysm=mysql_query($sqlsm);
$rowsm=mysql_fetch_array($querysm);
if($rowsm){
$ifshiming="1";
}else {
$ifshiming="2";		
}

if($_GET['act']=='add'){
    $addtime=date('Y-m-d H:i:s');
    $ywyuedu=$_POST['ywyuedu'];
	$ywyuedu1=rtrim($ywyuedu,",");	
    $title1=$_POST['title'];
    $ziwop1=$_POST['ziwop'];
    $shoparea=$_POST['city'];
    $moneyy=$_POST['num'];
    $fenlei=$_POST['fenlei'];	
	
$sql="insert into tbl_skill_details values(
        0,
        '".$_COOKIE['userid']."',		
        '".$title1."',
        '".$ziwop1."',
        '".$ywyuedu1."',
        '".$fenlei."',		
        0,
        0,
        '".$shoparea."',		
        '".$moneyy."',
        0,
        '".$addtime."',		
	    0
        )";
    $query=mysql_query($sql);

        if($query){
             echo "<script type='text/javascript'>alert('发布成功');location.href='index.php';</script>";
        }else{
            echo "<script type='text/javascript'>alert('发布失败');location.href='index.php';</script>";
        }
}
?> 
<!doctype html>
<html class="no-js">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta content="yes" name="apple-mobile-web-app-capable">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

  <title>照片分享-众晒网</title>
  <meta name="renderer" content="webkit">
    <!-- Set render engine for 360 browser -->


  <!-- No transcoding by search engine-->
  <meta http-equiv="Cache-Control" content="no-transform" />
  <meta http-equiv="Cache-Control" content="no-siteapp"/>
  <link rel="stylesheet" href="/ui/amui/css/amazeui.min.css">
    <link rel="stylesheet" href="/ui/amui/css/app.css">
<script src="/ui/amui/js/jquery.min.js"></script>
<script src="/ui/amui/js/amazeui.min.js"></script>
<link rel="stylesheet" href="/ui/amui/di/dist/amazeui.address.min.css">
<script src="/ui/amui/di/dist/iscroll.min.js">
</script> <script src="/ui/amui/di/dist/address.js"></script>
<script type="text/javascript" src="/ui/layer/mobile/layer.js"></script>  
<style type="text/css">
.am-input-group-warning .am-input-group-btn>.am-btn, .am-input-group-warning .am-input-group-label, .am-input-group-warning.am-input-group .am-form-field {
    border-color: #efa10000;
    border: 0;
    border-bottom: 1px solid #CCCCCC;
}
body {
    background: #f7f7f7;
    width: 100%;
    height:100%;

}
.am-padding-sm {
    .am-padding-sm {
    padding-left: 0px;
    padding-right: 0px;
}
.am-padding-sm {
    padding: 0px;
}
textarea#ziwop {
    font-size: 14px;
}


</style>
</head>
<body  style="margin-top:-25px">
<div class="am-alert am-alert-warning" style="margin-top:23px;background-color: #ffffff;"> 
 <a id="a1" onclick="disp_confirm()" ><img src="/ui/image/发布取消叉@3x.png" style="width: 15px; height: 15px; margin-top: -3px; margin-left: 5px;"></a>
        <button class="fabu" type="button" onclick="zouni()">发布</button>
</div>

  <div style="display:none">
            <input type="hidden" name="infoid" value="<?php echo time().rand(100,999);?>" />                   
        </div>  
       <div >
       <center>
            <div style="width:50px;height:80px" onclick="getElementById('inputfile').click()">
            <div style="float:left;width:60px;height:73px;margin-left:-26px;" >
            <img src="/ui/image/圆角矩形1141拷贝3@3x.png"  style="width:67px;height:67px" alt="" title="添加照片">
            <input type="file" accept="image/*"  id="inputfile" style="height:0;width:0;z-index: -1; position: absolute;left: 10px;top: -100px;"/>
            </div>
            </div>	
        </center>  
        </div>
            <div id="feedback"  value="feedback" name="ywyuedu" style="margin-bottom:10px">
            <input style=" display:none" id="srcall" name="ywyuedu">
            <input type="hidden" id="tuij" name="tuij" value="" />		
				<input type="hidden" name="lat" id="lat" value="" />
	
	             <input type="hidden" name="lng" id="lng" value="" />	

	            <input type="hidden" name="city" id="city" value="" />	
				
	             <input type="hidden" name="left" id="left" value="" />	

	            <input type="hidden" name="top" id="top" value="" />					
				
	            <input type="hidden" name="tija" id="tija" value="" />	
				
	            <input type="hidden" name="tuotitle2" id="tuotitle2" value="" />						

	            <input type="hidden" name="tjcount" id="tjcount" value="" />					
			
        </div>
<div class="am-input-group am-input-group-warning am-padding-sm" style="width:100%;margin:0; padding:0; border: 0;">
  <input type="text" name="title" id="title" style="width: 100%" class="am-form-field" placeholder="清晰明确的标题更吸引人">
</div>

<div class="am-input-group am-input-group-warning am-padding-sm am-round" style="width:100%; padding: 0">

  <textarea name="ziwop" id="ziwop" type="text" rows="5" cols="7" style="border-radius:5px 5px 5px 5px; border: 0; height:185px; font-size: 14px;" class="am-form-field"  placeholder="这一刻的想法..."></textarea>
</div>
<center>
			<div style="width:100%">
			<fieldset class="am-form-set" style="width:63%;margin-top:-23px;height:33px">
				<input type="text" name="city1" id="city1" readonly style="top:20px;padding:.55em;border:0;background-color:rgba(255, 255, 255, 0); font-size: 0.875rem;">
			</fieldset>			
			<button type="button"  class="am-btn am-btn-block am-margin-bottom-sm"	style="width:100%;float:left;margin-top:-27px;background-color: #ffffff;color:black; text-align: left; font-size: 0.875rem;">
				&nbsp;&nbsp;&nbsp;&nbsp;位置
			</button>

			</div>
			
</center>
<center>
<div>
<select name="fenlei" id="sheng" data-am-selected="{btnWidth: '100%', btnSize: 'sm', btnStyle: 'warning',dropUp: 1}">
  <option value ="0">选择分类</option>
   <?php 
       $sql_cat = "select * from tbl_mother_catgroy where status=0  and pid!=0 order by id asc";
       $query_cat = mysql_query($sql_cat);
       while ($row_cat=mysql_fetch_array($query_cat)) { 
   ?> 
       <option value ="<?php echo $row_cat['id']; ?>"><?php echo $row_cat['name']; ?></option>
   <?php } ?>  
</select>
<style type="text/css">
.am-btn-warning {
    color: #000;
    background-color: #ffffff;
    border-color: #ffffff;
}
.am-input-group-label {
    
    font-size: 0.875rem;
    
    color: #000;
    border: 0px solid #ccc;
    /* border-radius: 4px; */
    background: #ffffff;
}
img,input{border:none;vertical-align:middle;}
:focus {
    outline: none;
}
input#sname {background-color: rgba(204, 204, 204, 0);}
.fabu {
		    position: absolute;
		    top: 13px;
		    right: 10px;
		    border-radius: 6px;
		    width: 19%;
		    background: #ffa200;
		    border: 1px solid #ffa200;
		    color: white;
		}
am-alert>.am-close:first-child {
    float: left;
    height: auto;
    margin: -12px 0 auto -11px;
    /* left: 12px; */
}
.am-alert.am-alert-warning {
    height: 50px;
    width: 100%;
}
        #div1 {
            width: auto;
            height: auto;
            background: cyan;
            position: absolute;
	          background: #ffa200c4;
            border-radius: 10px;
            background-color: rgba(255, 162, 0, 0);
            color: #ffffff;
        }
.aui-search-box1 {
    left: 25px;
    background: #f4f4f4;
    width: 65%;
    height: 25px;
    line-height: 22px;
    position: relative;
    margin: 5px auto;
    align-content: center;
    position: fixed;
    top: 6px;
    right: 60px;
  border-radius: 30px;
  text-align: center;
}
.aui-shop-list-item-hd {
    height: 110px;
}
.sousuo{
    height: 23px;
    width: 42px;
    border: 1px solid #ffa200;
    color: #ffa200;
    text-align: center;
    border-radius: 9px;
    position: fixed;
    margin-right: 1px;
    top: 12px;
    right: 9px;
}
.quereng{   
    background: #ffa200;
    border: 0;
    color: white;
    font-weight: 400;
    font-size: 16px;
    height: 38px;
    text-align: center;
    line-height: 33px;
    border-radius: 7px;
    margin: 0px 30px;
    margin-bottom: 10px;
}
.H-theme-background-color9 {
    background-color: #ffffff;
    height: 50px;
}

.H-header {
    min-height: 44px;
}
input[type="checkbox"] {
    
    background: #ffa200;
    border: 2px solid #ffe2e2;
}

        input[type="checkbox"] {
                display: none;
        }
        [type="checkbox"] {
            box-sizing: border-box;
            -webkit-box-sizing: border-box;
            padding: 0;
            border-radius: 0;
            -webkit-border-radius: 0;
        }
        input[type="checkbox"]:checked + i {
            background: #ffa200;
            border: 2px solid #ffe2e2;
        }
        label{
            margin-top: -16px;
            margin-right: 5px;
        }
        label i {

            border-radius: 11px;
            width: 20px;
            height: 20px;
            border: #ffa200 1px solid;
        }
        label i {
            font-size: 12px;
            font-style: normal;
            display: inline-block;
            width: 12px;
            height: 12px;
            text-align: center;
            line-height: 12px;
            color: #ffa200;
            vertical-align: middle;
            margin: -2px 2px 1px 0px;
            
        }
        .layui-m-layerchild h3 {
            font-size:15px;
            font-weight: 600;
            margin-top: 10px;
        }
        .aui-special-etc-hd{
            font-size: 16px;

        }
        #queding{
            top: 10px;
            right: 10px;
            border-radius: 6px;
            width: 55px;
            background: #ffa200;
            border: 1px solid #ffa200;
            color: white;
            font-weight: 400;
            font-size: 14px;
            height: 25px;
        }
        .btn-define-1, .btn-define-1:hover {
    background-color: #ffa200;
    color: #ffffff;
    height: 25px;
}
.yd-textarea>textarea {
    border: none;
    width: 100%;
    display: block;
    height: 1.5rem;
    font-size: .3rem;
    background-color: transparent;
    height: 240px;
}
.layui-m-layerchild.layui-m-anim-up {
    float: right;
    text-align: center;
    
}
button.btn {
    
    right: 11px;
}
h3{
  color: black;
}
.am-ucheck-checkbox:hover:not(.am-nohover):not(:disabled)+.am-ucheck-icons {
    color: #ffa200;
}
i.am-icon-unchecked{
  color: #ffa200;
  border: 0;
}
i.am-icon-checked {
    border: 0;
}
.am-checkbox .am-icon-checked, .am-checkbox .am-icon-unchecked, .am-checkbox-inline .am-icon-checked, .am-checkbox-inline .am-icon-unchecked, .am-radio .am-icon-checked, .am-radio .am-icon-unchecked, .am-radio-inline .am-icon-checked, .am-radio-inline .am-icon-unchecked {
   
    left: 5px;
    top: 4px;
    
}
.am-form-group {
    width: 60%;
    line-height: 32px;
}
.am-checkbox-inline+.am-checkbox-inline, .am-radio-inline+.am-radio-inline {
    margin-left: 30px;
}
.layui-m-layer0 .layui-m-layerchild {
    width: 70%;
    max-width: 640px;
    height: 117px;
}
.layui-m-layer * {
    overflow: auto;
}*
div#shoplister {
    height: 520px;
}
</style>

</div>
</center>
<br/>
<center>
      <div style="width:100%; height: 35px; background: #fff;">
        <span style="float: left; font-size: 15px; margin-left: 13px; line-height: 35px;">发布者：</span>
							<?php if($ifshiming==2){ ?>
          <label class="am-radio-inline" style="margin-top: 0;">
            <input type="radio" name="radio10" value="male" onclick="showt()" data-am-ucheck > 商家
          </label>
		  					<?php } ?>
							
		  					<?php if($ifshiming==1){ ?>
          <label class="am-radio-inline" style="margin-top: 0;">
            <input type="radio" name="radio10" onclick="is_business1()" value="male" data-am-ucheck > 商家
          </label>	
		  					<?php } ?>
          <label class="am-radio-inline">
            <input type="radio" name="radio10" value="female" data-am-ucheck> 个人
          </label>
  
        </div>
      </div>
      
</center>
<script type="text/javascript">

function showt(){
  s=1;
 
if(s==1){//如果show是隐藏的
 
alert('请完成商户认证');
 location.href="shengjiqy.php";
 
}
 
}
function is_business0(){
	
$("#is_business3").val('0');	
	
}

function is_business1(){
	
$("#is_business3").val('1');	
	
}
</script>






<script type="text/javascript">
function zouni(){

				 var lat=$("#lat").val();
				 var lng=$("#lng").val();				 
				 var city=$("#city").val();
				 var uid='<?=$_COOKIE['userid']?>';
				 var title=$("#title").val();
                 var pic_content=$("#ziwop").val();
                 var pic_arr=$("#tija").val();
				 var tjcountt=$("#tjcount").val();
                 var fenlid=$("#sheng option:selected"); //获取选中的项
				 var fenlidd=fenlid.val();
		         var pics=document.getElementsByName('thissrc')[0].src;
				 var is_business3= $("#is_business3").val();	
				// var pics='1.jpg';
				    console.log(lat);	
				    console.log(lng);
				    console.log(city);
				    console.log(uid);
				    console.log(title);
				    console.log(pic_content);
				    console.log(pic_arr);
				    console.log(fenlidd);
				    console.log(pics);					
		if(pic_arr==""){
	layer.open({
    content: '请上传照片'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
 return false;  
	}

			if(tjcountt<3){
	layer.open({
    content: '请上传三张以上照片'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
 return false;  
	}
	
		if(pic_arr==""){
	layer.open({
    content: '请填写标题'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
 return false;  
	}

		if(pic_content==""){
	layer.open({
    content: '请填写内容'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
 return false;  
	}
		if(fenlidd==""){
	layer.open({
    content: '请选择分类'
    ,skin: 'msg'
    ,time: 2 //2秒后自动关闭
  });
 return false;  
	}




	
                                  $.ajax({
                                        url: '/api/muyin/api.php?s=mother.save_picture_article',
                                        type: 'POST',
                                        dataType: 'json',
                                        data: {uid: uid,
										title:title,
										pic_content:pic_content,
										cat_id:fenlidd,
										pic_arr:pic_arr,
										lat:lat,
										lng:lng,
										pics:pics,
									    is_business3:is_business3,
										city:city
										},
                                      })
                                      .done(function(respon) {
                                        if (respon.code==0) {
     layer.open({
    content: '发布成功'
    ,btn: ['知道了']
    ,yes: function(index){
      window.location.href="index.php";
      layer.close(index);
    }
  });
                                      
                                        }else{
                                            
                                        alert('错误，稍后再试');
                                        }
                                      })
  
}

</script> 


    <script>  
        if (navigator.geolocation){  

            navigator.geolocation.getCurrentPosition(  

                function( position ) {    

                    show_msg( position );  

                 },  

                function( err ) {  

                    switch(error.code){  
                    case 0:  
                      alert("尝试获取您的位置信息时发生错误：" + error.message);  
                      break;  
                    case 1:  
                        alert("用户拒绝了获取位置信息请求。");  
                      break;  
                    case 2:  
                        alert("浏览器无法获取您的位置信息：" + error.message);  
                      break;  
                    case 3:  
                        alert("获取您位置信息超时。");  
                      break;  
                    }  
                }  
       )}else  
          alert( '您当前使用的浏览器不支持Geolocation服务' );  


        function show_msg( position ){  

            var lat = position.coords.latitude;

            var lng = position.coords.longitude; 
            $("#lat").val(lat);
			$("#lng").val(lng);
			
           // alert( "您所在的位置： 经度" +  + "，纬度" + lng );  
            if( typeof position.address != "undefined" ){  

                var country = position.address.country; 

                var province = position.address.region;

                var city = position.address.city;  

               // alert(' 您位于 ' + country + province + '省' + city +'市');  
            }  
			
			  var latlon = position.coords.latitude+','+position.coords.longitude; 
 
  //baidu
  var url = "http://api.map.baidu.com/geocoder/v2/?ak=C93b5178d7a8ebdb830b9b557abce78b&callback=renderReverse&location="+latlon+"&output=json&pois=0"; 
  $.ajax({ 
    type: "GET", 
    dataType: "jsonp", 
    url: url, 
      beforeSend: function(){ 
       
		console.log('正在定位...');
      }, 
      success: function (json) { 
        if(json.status==0){ 
         // $("#baidu_geo").html(json.result.formatted_address); 
		 // alert(json.result.addressComponent.city);
		 $("#city").val(json.result.addressComponent.city);
         $("#city1").val(json.result.addressComponent.city);		 
        } 
      }, 
      error: function (XMLHttpRequest, textStatus, errorThrown) { 
        $("#baidu_geo").html(latlon+"地址位置获取失败"); 
    } 
  });
				
        }  
    </script> 


		<script type="text/javascript">
			$(function() {

				//	自定义输出
				$("#address1").address({
					customOutput: true,
					selectNumber: 2,
					selectEnd: function(json,address) {
						for(var key in json) {
							$("#signupok").find("input[name='" + key + "']").val(json[key]);
						}
					}
				}).on("provTap",function(event,activeli){
					console.log(activeli.text());
				}).on("cityTap",function(event,activeli){
					console.log(activeli.text());
				})
			});
		</script>
		
		<script>
		function zu(){
		var tuoleft=document.getElementById("left").value;	
		
		var tuotop=document.getElementById("top").value;		
			
		var legth=document.getElementsByName('thissrc')[0].src;
				//alert(legth);
		var tuij=document.getElementById("tuij").value;	
		
		var tuotitle3=document.getElementById("tuotitle2").value;				
		var json = [];
        var j = {};
            j.pic_url = legth;
            j.tag_list =  [{
			location:{	
        "l1": tuoleft,
        "l2": tuotop
			},
		 rate_good_id :tuij,
		 rate_content : tuotitle3	
    }]; 
            json.push(j); 

	
        var a = JSON.stringify(json);
		
		

		var b= $("#tija").val();

		if(b==""){
	        $("#tija").val(a);	
	        $("#tjcount").val("1");	
	
		}else {
			
		var json =JSON.parse(b);
		
		//var json = [{"name":"caocao","sex":"男"}];
        var j = {};
            j.pic_url = legth;
		j.tag_list =  [{
			location:{	
        "l1": tuoleft,
        "l2": tuotop
			},
		 rate_good_id :tuij,
		 rate_content : tuotitle3	
    }]; 	
            json.push(j); 

        var c = JSON.stringify(json);

		$("#tija").val(c);	
			
		 var tjcount=document.getElementById('tjcount').value;	
	         tjcount_new=1+ parseFloat(tjcount);		 
	        $("#tjcount").val(tjcount_new);	
		}
		

		}
		</script>
		
		
		
	<script>
	
	

	
	</script>	
		
		
		<script>
		function xuan(){
			
	var pageii = layer.open({
   type: 1
  ,content:'<header class="H-header H-theme-background-color9" id="header">'
        +'<div class="aui-search-box1">'
        +'<i class="icon icon-search"></i>'
        +'<input type="text" id="sname" placeholder="搜索你要推荐的商品">'
    +'</div>'
	 +'<div class="sousuo" onclick="tuijianlistapi()">搜'
	  +'</div>'
    +'</header>'	
          +'<div id="shoplister" style="width:100%; height:auto;">' 
	+'</div>'
  +'<div>'
  
  +'<button class="quereng" onclick="getTheCheckBoxValue()" style="width: 30%; font-weight:800;float:right; margin-left:20px;">下一步</button>'
  +'<button class="quereng" onclick="getTheCheckBoxValue()" style="width: 30%; font-weight:800;float:left; margin-right:20px;">确认推荐</button>'
  +'</div>'
  ,anim: 'up'
  ,style: 'position:fixed; left:0; top:0; width:100%; height:100%; border: none; -webkit-animation-duration: .5s; animation-duration: .5s;'
});
	

	var psize='10';
	var type='1';	
				   $.ajax({
        url: '/api/muyin/api.php?s=haigou.get_haigou_list',
        type: 'GET',
        dataType: 'json',

		data: {psize: psize,
		type:type
		
		},
     success: function (data){
         var JSON = eval(data); 


        if (data.code==0) {		
		var arrLen = JSON.data.length;
        if(arrLen > 0){
          
		  for(var i=0; i<arrLen; i++){
             var imgUrlArr=JSON.data[i].img;
            var imgUrl=imgUrlArr.split(',', 1); 
                    
             var result = '';
           result +='<label style="width:100%;">'
                     +'<div class="aui-shop-list-item-hd">'
                     +'<a>'
                     +'<img src="'+imgUrl+'" alt="" style="float:left; height:100px; border-radius:5px;">'
                     + '<h3>'+JSON.data[i].chtitle+'</h3>'
                     + ' <span class="aui-special-etc-hd" style="color:#ffa200;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;￥'+JSON.data[i].zswprice+'</span>'
                     +'</a>'
                     
                     +'<input type="checkbox" value="'+JSON.data[i].id+'" name="sProblem">'
                     +'<i style="float:right; margin-top: -10px; margin-right:5px;">'+'</i>'
                     +'</label>'  
                  +'</div>'
		   
		  
		   
          $("#shoplister").append(result);
          
		  }
		

		}
        }
	 }
      })					
			
		}
		
		
		// kkk
		
				function getTheCheckBoxValue(){
		
       var checkboxValue= new Array();  
       var checkboxText= new Array();  
       var checkboxStr=document.getElementsByName("sProblem");    
       for(var i=0; i<checkboxStr.length; i++){  
        if(checkboxStr[i].checked){  
                //alert(checkboxStr[i].value+","+checkboxStr[i].nextSibling.nodeValue);  
            checkboxValue.push(checkboxStr[i].value);  
                    checkboxText.push(checkboxStr[i].nextSibling.nodeValue);  
         }  
        }   
        //输出值和文本  
        
		 checkboxValue=checkboxValue.toString();  

 $("#tuij").val(checkboxValue);
 zu();
layer.closeAll();

	}
		
			function tuijianlistapi(){
		
	var snamee=document.getElementById("sname").value; 
			 $("#shoplister").empty();
			 var psize='10';
		   $.ajax({
        url: '/api/muyin/api.php?s=haigou.get_haigou_list',
        type: 'GET',
        dataType: 'json',
        data: {keyword: snamee,
		psize:psize
		},

     
     success: function (data){
         var JSON = eval(data); 


        if (data.code==0) {		
		var arrLen = JSON.data.length;
        if(arrLen > 0){
          
		  for(var i=0; i<arrLen; i++){
             var imgUrlArr=JSON.data[i].img;
            var imgUrl=imgUrlArr.split(',', 1); 
                    
             var result = '';
           result +='<div class="aui-shop-list-item-hd">'
                     +'<a>'
                     +'<img src="'+imgUrl+'" alt="" style="float:left; height:100px; border-radius:5px;">'
                     + '<h3>'+JSON.data[i].chtitle+'</h3>'
                     + ' <span class="aui-special-etc-hd" style="color:#ffa200;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;￥'+JSON.data[i].zswprice+'</span>'
                     +'</a>'
                     +'<label  style="float:right;">'
                     +'<input type="checkbox" value="'+JSON.data[i].id+'" name="sProblem">'
                     +'<i>'+'</i>'
                     +'</label>'  
                  +'</div>'
					
			
          $("#shoplister").append(result);
          
		  }
		

		}
        }
	 }
      }) 
	
		
	}
		
		</script>
		
		
<script type="text/javascript">
$(document).ready(function(){
    //响应文件添加成功事件
    $("#inputfile").change(function(){
        //创建FormData对象
        var data = new FormData();
        //为FormData对象添加数据
        $.each($('#inputfile')[0].files, function(i, file) {
            data.append('upload_file'+i, file);
        });
        $(".loading").show();   //显示加载图片
        //发送数据
        $.ajax({
            url:'submit_form_process.php',
            type:'POST',
            data:data,
            cache: false,
            contentType: false,     //不可缺参数
            processData: false,     //不可缺参数
            success:function(data){
                data = $(data).html();
               //alert(data);
                //第一个feedback数据直接append，其他的用before第1个（ .eq(0).before() ）放至最前面。
                //data.replace(/&lt;/g,'<').replace(/&gt;/g,'>') 转换html标签，否则图片无法显示。
                if($("#feedback").children('img').length == 0) $("#feedback").append(data.replace(/&lt;/g,'<').replace(/&gt;/g,'>'));
                else $("#feedback").children('img').eq(0).before(data.replace(/&lt;/g,'<').replace(/&gt;/g,'>'));
	
	
	
	
	           pic_content();
	
                $(".loading").hide();   //加载成功移除加载图片
            },
            error:function(){
                alert('上传出错');
                $(".loading").hide();   //加载失败移除加载图片
            }
        });
    });
});
</script>

		<script>
		function tuo(){
		var tuoimg=document.getElementsByName('thissrc')[0].src;
       var biaoji=document.getElementById('tuotitle2').value;		
	var pageii = layer.open({
   type: 1
  ,content:' <div id="div1" style="left: 40%; top: 60%;"><img src="ui/image/dian.png" style="width:10px;">'+'<span>'+biaoji+'</span>'+'</div>'
  + '<div onclick="tuook()"  style="text-align:center; float: right;border: 2px solid #ffa200;width: 60px;margin-top: 5px;color: #ffffff;background: #ffa200;margin-right: 5px;height: 23px;border-radius: 5px; z-index:2;">下一步</div>'
  ,anim: 'up'
  ,style: 'position:fixed; left:0; top:0; width:100%; height:100%; border: none; -webkit-animation-duration: .5s; animation-duration: .5s; '
  +'background:url('+tuoimg+') no-repeat center;background-size:contain;'
});
}
</script>


		<script>
		function pic_content(){
		var tuoimg=document.getElementsByName('thissrc')[0].src;	
	var pageii = layer.open({
   type: 1
  ,content:'<div style="position: fixed;width: 60%;background: #cccccc57;height: 172px;border-radius: 5px;text-align: center;margin: 20% 20%;background-color: rgba(204, 204, 204, 0.34);" ><div onclick="tuocontent()"> <h2 style="margin-top:1em;">点击添加标记</h2><p>标记图片关键位置 </p><p style="color:#000000;">点击右上角刷新页面替换图片</p></div><p onclick="tuook()" style="color:#f17215;">下一步</p></div>'
  ,anim: 'up'
  ,style: 'height: 60px;width:100%; height:100%; text-align: center;border: none; -webkit-animation-duration: .5s;background: #9a9a9a8a; color: #ffffff;background-color: rgba(154, 154, 154, 0.54);animation-duration: .5s;'
  +'background:url('+tuoimg+') no-repeat center;background-size:contain;'
});

		}
</script>

<script>
function tuocontent(){
layer.open({
  content: '<input id="tuotitle" style="height: 30px; border: 1px solid #CCC;border-radius: 5px;margin-top: -15px;" >'
  +'<div onclick="tuotitle1()" style="background: #ffa200;border-radius: 5px; width: 30%;margin: 0 auto; color: #ffffff; margin-top:5px;"> 确定</div>',
  shadeClose: false,
});
	
	
}

function tuotitle1(){
	
	var tuotitle2=document.getElementById("tuotitle").value;
	if(tuotitle2==""){
	    layer.open({
    content: '请输入内容!'
    ,skin: 'msg'
    ,time: 2
  });
  
	return false;	
	
	}else {
		
	 $("#tuotitle2").val(tuotitle2);	
	
	tuo();
		
	}

	
	
}




</script>


<script>
function tuook(){
var tuoleft = '40%';
var tuotop = '60%';

 $("#top").val(tuotop);
 
 $("#left").val(tuoleft);
 
 zu();
	
	layer.closeAll();
}


</script>

<script type="text/javascript">
           var div1=document.querySelector('#div1');
          var maxW=document.body.clientWidth-div1.offsetWidth;
          var maxH=document.body.clientHeight-div1.offsetHeight;

    div1.addEventListener('touchstart',function(e){
        var ev = e || window.event;
        var touch = ev.targetTouches[0];
        oL = touch.clientX - div1.offsetLeft;
        oT = touch.clientY - div1.offsetTop;
        document.addEventListener("touchmove",defaultEvent,false);
    })


    div1.addEventListener('touchmove',function(e){
        var ev = e || window.event;
       var touch = ev.targetTouches[0];
       var oLeft = touch.clientX - oL;
       var oTop = touch.clientY - oT;
       if(oLeft<0){
           oLeft=0;
       }else if (oLeft>=maxW) {
           oLeft=maxW;
       }
       if(oTop<0){
           oTop=0;
       }else if (oTop>=maxH) {
           oTop=maxH;
       }

       div1.style.left = oLeft + 'px';
       div1.style.top = oTop + 'px';
       var bL=oLeft/document.body.clientWidth*100;
       var bT=oTop/document.body.clientHeight*100;
      
    })

    div1.addEventListener('touchend',function(){ 
       document.removeEventListener("touchmove",defaultEvent);
    })
    function defaultEvent(e) {


       e.preventDefault();
     }

     
</script>


<script type="text/javascript">
    function clicimg(){
        var legth=document.getElementsByName('thissrc');
        var srca="";
        for(var i=0;i<legth.length;i++){
            srca+=legth[i].src;
            srca+=",";
        }
		
        document.getElementById('srcall').value=srca;
    }
</script>	
<script type="text/javascript">
$(function () {  
            //防止页面后退  
            history.pushState(null, null, document.URL);  
            window.addEventListener('popstate', function () {  
            history.pushState(null, null, document.URL);  
            });  
        }) 
</script>
<script type="text/javascript">
function disp_confirm()
  {
  var r=confirm("确定返回将不保存您编辑的内容")
  if (r==true)
    {
     window.location.href="index.php"
    }
  }
</script>	

</body>
<style type="text/css">
.am-dropdown-content {
    position: inherit;
}
.layui-m-layerchild.layui-m-layer-msg.layui-m-anim-up {
    margin: 0px 30%;
}
.layui-m-layer0 .layui-m-layerchild {
    height: auto;
}
</style>
</html>
